<?php

$this->dojo()->addStyleSheet($this->dojo()->getCdnBase() . $this->dojo()->getCdnVersion() . '/dojox/grid/resources/tundraGrid.css')
             ->requireModule('core.grid.Scaffold')
             ->onLoadCaptureStart();
?>
function(){
    var cells = [
    {
        name: "<?php $this->_e('Id')?>",
        field: "id",
        width:'100px'
    },
    {
        name: "<?php $this->_e('Name')?>",
        field: "name",
        width:'auto'
    },
    {
        name: "<?php $this->_e('Value')?>",
        field: "value",
        width:'100px'
    },
    {
        name: "<?php $this->_e('Type')?>",
        field: "type",
        width:'100px'
    },
    {
        name: "<?php $this->_e('Namespace')?>",
        field: "namespace",
        width:'100px'
    }



    ];

    dojo.require('core.grid.Scaffold');
    var datagrid = new core.grid.Scaffold(cells,
                                           'gridContainer',
                                         '<?php echo $this->url();?>',
                                         true,
                                         true);
}
<?php $this->dojo()->onLoadCaptureEnd(); ?>
<div class="gridControl">
<?php
    echo $this->comboBox('grid-field',
                         'id',
                         array('jsid'=>'grid-field','autocomplete' => false),
                         array(),
                         array('id'  => $this->__('Id'),
                               'name'   => $this->__('Name'),
                               'value' => $this->__('Value'),
                               'type' => $this->__('Type'),
                               'namespace' => $this->__('Namespace')
                              )
                        );
    echo $this->validationTextBox('grid-filter',
                                  '*',
                                  array('jsid'=>'grid-filter',
                                        'regExp'=> '[\S\s]+',
                                        'required'=> 'true'),
                                  array('style'=>'padding:2px 1px 1px')
                                  );

    echo $this->button('grid-search',
                       $this->__('Filter'),
                       array('jsid'      => 'grid-search',
                             'baseClass' => 'gridButton'));
    echo $this->button('grid-undo',
                       $this->__('Undo'),
                       array('jsid'      => 'grid-undo',
                             'baseClass' => 'gridButton'));
?>
</div>

<div class="gridContainer" id="gridContainer" style="height:300px;"></div>

<div class="gridControl">
<?php
    echo $this->button('grid-new',
                       $this->__('Create New'),
                       array('jsid'      => 'grid-new',
                             'baseClass' => 'gridButton'));
    echo $this->button('grid-del',
                       $this->__('Delete Selected'),
                       array('jsid'      => 'grid-del',
                             'baseClass' => 'gridButton'));
?>
</div>


